﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="khaibaochuongtrinhkhuyenmai.ascx.cs" Inherits="Webusercontrol_khaibaochuongtrinhkhuyenmai" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<%@ Register src="uscMsgBox.ascx" tagname="uscMsgBox" tagprefix="uc2" %>
<link rel="stylesheet" href='<%=ResolveUrl("~/LayoutCss/K_BaoCaoFormLayout.css")%>' type="text/css" />
<link rel="stylesheet" href='<%=ResolveUrl("~/LayoutCss/datePicker.css")%>' type="text/css" />


<script type="text/javascript">
     function pageLoad() {
     $(function()
        {
	            $("#<%= txtFromDate.ClientID %>").datePicker(
	                {
	                    clickInput:true,
			            startDate: '01/01/1970'
	                }
	                );
        });
	            
	            $("#<%= txtFromDate.ClientID %>").bind(
		            'dpClosed',function(e, selectedDates)
		                        {
			                        var d = selectedDates[0];
			                        if (d) {
				                            d = new Date(d);
				                            $("#<%= txtToDate.ClientID %>").dpSetStartDate(d.addDays(0).asString());
			                                }
		                        }
	                    );
	                    
	     $(function()
        {
	            $("#<%= txtToDate.ClientID %>").datePicker(
	                {
	                    clickInput:true
			           
	                }
	                );
        });
	
	          $("#<%= txtToDate.ClientID %>").bind(
		           'dpClosed',function(e, selectedDates)
		                        {
			                        var d = selectedDates[0];
			                        if (d) {
				                            d = new Date(d);
				                            $("#<%= txtFromDate.ClientID %>").dpSetEndDate(d.addDays(0).asString());
			                                }
		                        }
	            );

     
     $(function()
        {
	            $("#<%= txt_fromdate.ClientID %>").datePicker(
	                {
	                    clickInput:true,
			            startDate: '01/01/1970'
	                }
	                );
        });
	            
	            $("#<%= txt_fromdate.ClientID %>").bind(
		            'dpClosed',function(e, selectedDates)
		                        {
			                        var d = selectedDates[0];
			                        if (d) {
				                            d = new Date(d);
				                            $("#<%= txt_todate.ClientID %>").dpSetStartDate(d.addDays(0).asString());
			                                }
		                        }
	                    );
	                    
	     $(function()
        {
	            $("#<%= txt_todate.ClientID %>").datePicker(
	                {
	                    clickInput:true
			           
	                }
	                );
        });
	
	          $("#<%= txt_todate.ClientID %>").bind(
		           'dpClosed',function(e, selectedDates)
		                        {
			                        var d = selectedDates[0];
			                        if (d) {
				                            d = new Date(d);
				                            $("#<%= txt_fromdate.ClientID %>").dpSetEndDate(d.addDays(0).asString());
			                                }
		                        }
	            );

   

      $("#<%= bt_taomoi.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } }); 
        }); 
        $("#<%= bt_Luu.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } }); 
        }); 
      
         $("#<%= ImageButton1.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } }); 
        }); 
        
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
                function EndRequestHandler(sender, args) {
                        $.unblockUI();
                }
        }  
   
</script> 


<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <fieldset>
    <legend>Khai báo chương trình khuyến mãi</legend>
    </fieldset>
         <asp:Panel ID="Panel1" runat="server" BackColor="#EBEBEB" 
                        BorderStyle="None" Height="33px" Width="100%">
                        <asp:ImageButton ID="bt_taomoi" runat="server" CausesValidation="False" OnClick="bt_taomoi_Click"
                            Height="25px" ImageUrl="~/image/New File.png"      ToolTip="Tạo mới" Width="25px" />
                        &nbsp;<asp:ImageButton ID="bt_Luu" runat="server" Height="25px" 
                            ImageUrl="~/image/floppy disk.png" OnClick="bt_Luu_Click"
                            ToolTip="Cập nhật" Width="25px"/>
                        
         </asp:Panel>
<br />
         <cc1:TabContainer ID="TabContainer1" runat="server"   ActiveTabIndex="0" Width="1015px" AutoPostBack ="true" >
           <cc1:TabPanel ID="TabPanel2" TabIndex="0" runat="server" HeaderText="Nhập thông tin">
                    <ContentTemplate>
                      <fieldset>
                          
                   <div class="fm-req">
                       <label for="txtFromDate">Mã CTKM</label>
                       <asp:TextBox ID="txt_ID" BackColor="Yellow" ReadOnly="true" runat="server" Width="200px"></asp:TextBox>
                    </div>
                     <div class="fm-req">
                       <label for="txtFromDate">Mô tả</label>
                       <asp:TextBox ID="txt_proDes" runat="server" Width="300px"></asp:TextBox>
                     </div>  
                     <div class="fm-req">
                       <label for="txtFromDate">Từ ngày</label>
                       <asp:TextBox ID="txt_fromdate" runat="server"   Width="100px"></asp:TextBox>
                    </div>
                     <div class="fm-req">
                       <label for="txtFromDate">Đến ngày</label>
                       <asp:TextBox ID="txt_todate" runat="server" Width="100px"></asp:TextBox>
                    </div> 
                      <div class="fm-req">
                       <label for="txtFromDate">Kích hoạt</label>
                       <asp:CheckBox ID="chActive" runat="server" />
                    </div>           
                      <div class="fm-req">
                       <label for="txtFromDate">Mô tả chi tiết</label>
                       <asp:TextBox ID="txtMoreDes" runat="server" Width="200px" Height="50px" TextMode="MultiLine"></asp:TextBox>
                      </div>  
                    </ContentTemplate>
                    </cc1:TabPanel>
           <cc1:TabPanel runat="server" TabIndex="1" HeaderText="Tìm kiếm CTKM" ID="TabPanel1">
                    <ContentTemplate>
                    <fieldset>
                    <div class="fm-req">
                       <label for="txtFromDate">Từ ngày:</label>
                       <asp:TextBox ID="txtFromDate" runat="server"></asp:TextBox>
                   </div>
                   <div class="fm-req">
                       <label for="txtFromDate">Đến ngày:</label>
                       <asp:TextBox ID="txtToDate" runat="server"></asp:TextBox>
                       <asp:ImageButton ID="ImageButton1" runat="server" onclick="ImageButton1_Click"     Width="16px" ImageUrl="~/image/Find.png" />
                   </div>
                   </fieldset>
         
        <br />
             <asp:GridView ID="GridView2" runat="server" AllowPaging="True" 
                                    AutoGenerateColumns="False" BackColor="#DEBA84" BorderColor="#DEBA84" 
                                    BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" 
                                    DataKeyNames="Program_ID"  onpageindexchanging="GridView2_PageIndexChanging"  
                                    OnRowCommand="GridView2_RowCommand" PageSize="5" Width="306px">
                                    <Columns>
                                        <asp:BoundField DataField="Program_ID" HeaderText="Mã CTKM" />
                                        <asp:BoundField DataField="Program_Des" HeaderText="Mô tả" />
                                        <asp:TemplateField>
                                            <ItemTemplate>
                                                <asp:Button ID="Button2" runat="server" CausesValidation="false" Width="100px" 
                                                    CommandName="chon" Text="Chọn" />
                                            </ItemTemplate>
                                            <FooterStyle BackColor="White" BorderColor="White" />
                                            <HeaderStyle BackColor="White" BorderColor="White" />
                                            <ItemStyle BackColor="White" BorderColor="White" />
                                        </asp:TemplateField>
                                    </Columns>
                                    <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
                                    <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
                                    <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                                </asp:GridView>  
         
                    </ContentTemplate>
                    </cc1:TabPanel>
                  
</cc1:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
   <uc2:uscMsgBox ID="uscMsgBox1" runat="server" />




 
           

 




 
           

 